fix(joint-react): fix links flickering#3159
Open
samuelgja wants to merge 7 commits intoclientIO:devfrom
Open
Conversation
…intJS elements and links - Add BatchCache class for managing batched updates for links, ports, and clear views. - Introduce ClearViewCacheEntry and related functions for managing clear view updates. - Create PortUpdateCacheEntry and functions for merging port updates and groups. - Implement state flushing functions to handle element and link updates in a React-friendly manner. - Develop example story demonstrating cell actions with dynamic node and link management. - Define GraphSchedulerData type for unified scheduling of updates across elements, links, and ports.
…in various components and tests - Updated GraphProvider stories to remove 'id' from elements and links. - Cleaned up highlighter tests by removing 'id' from element definitions. - Adjusted stroke highlighter tests to eliminate 'id' from elements. - Modified paper tests to remove 'id' from elements and links. - Refactored port tests to exclude 'id' from elements. - Updated hooks tests to remove 'id' from elements. - Cleaned up model tests by removing 'id' from ReactElement and ReactLink instances. - Adjusted example stories to remove 'id' from elements and links.
791bf5a to
33b456b
Compare
samuelgja
commented
Jan 31, 2026
samuelgja
commented
Jan 31, 2026
packages/joint-react/src/store/__tests__/create-elements-size-observer.test.ts
Show resolved
Hide resolved
81e6e85 to
39f60c8
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes link flickering issue where links would briefly appear before element content was rendered.
Motivation and Context
The Bug: When rendering a Paper with elements and links, the visual sequence was:
This happened because JointJS renders link SVG paths synchronously, while React portals render element content via microtask (later).
Changes
create-elements-size-observer.tsto ensure consistent timing between link paths and element contentpaper-link-flickering.test.tsx) that verifies the invariant: "If links are visible with rendered paths, elements must also have their content rendered"